package utils

import (
	"crypto/sha256"
	"encoding/hex"
	"time"
)

func GenerateToken(username string) string {
	currentTime := time.Now().String()
	str := currentTime + username
	hasher := sha256.New()
	hasher.Write([]byte(str))
	token := hasher.Sum(nil)
	return hex.EncodeToString(token)
}
